﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x0200043C RID: 1084
	[DisallowMultipleComponent]
	public class ObservablePointerExitTrigger : ObservableTriggerBase, IEventSystemHandler, IPointerExitHandler
	{
		// Token: 0x060016C3 RID: 5827 RVA: 0x00062508 File Offset: 0x00060908
		void IPointerExitHandler.OnPointerExit(PointerEventData eventData)
		{
			if (this.onPointerExit != null)
			{
				this.onPointerExit.OnNext(eventData);
			}
		}

		// Token: 0x060016C4 RID: 5828 RVA: 0x00062524 File Offset: 0x00060924
		public IObservable<PointerEventData> OnPointerExitAsObservable()
		{
			Subject<PointerEventData> result;
			if ((result = this.onPointerExit) == null)
			{
				result = (this.onPointerExit = new Subject<PointerEventData>());
			}
			return result;
		}

		// Token: 0x060016C5 RID: 5829 RVA: 0x0006254C File Offset: 0x0006094C
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onPointerExit != null)
			{
				this.onPointerExit.OnCompleted();
			}
		}

		// Token: 0x04000CBD RID: 3261
		private Subject<PointerEventData> onPointerExit;
	}
}
